package com.hzpd.hainan.module.newspager;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.JavascriptInterface;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.LinearLayout;

import com.hzpd.hainan.R;
import com.hzpd.hainan.api.InterfaceJsonfile;
import com.hzpd.hainan.app.BaseFragment;
import com.hzpd.hainan.config.CODE;
import com.hzpd.hainan.model.newspager.NewsPaper_Bean;
import com.hzpd.hainan.module.newspager.adapter.NewsPaperListAdapter;
import com.hzpd.hainan.wxapi.SharedUtil;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * Created by Administrator on 2017/7/12.
 */

public class SBZFragemnt_six extends BaseFragment {
    @BindView(R.id.mynews_listview)
    RecyclerView mynews_listview;
    private NewsPaperListAdapter adapter;
    private  List<NewsPaper_Bean> list;
    @Override
    public int setMyContentView() {
        return R.layout.szb_list_layout;
    }
    public static SBZFragemnt_six newInstance() {
        SBZFragemnt_six newsPagerFragment = new SBZFragemnt_six();
        return newsPagerFragment;
    }
    @Override
    public void initView() {
        final LinearLayoutManager layoutManager = new LinearLayoutManager(activity);
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        mynews_listview.setLayoutManager(layoutManager);
    }

    @Override
    public void initData() {
        list = new ArrayList<>();
        if (spu.getLanguage().equals(CODE.ZHONGWEN)){
            NewsPaper_Bean bean1 = new NewsPaper_Bean();

            bean1.setName("海南藏文报");
            bean1.setUrl("http://hnzw.x-publish.com/");
            list.add(bean1);

            NewsPaper_Bean bean2 = new NewsPaper_Bean();
            bean2.setName("人民日报");
            bean2.setUrl("http://tibet.cpc.people.com.cn/");
            list.add(bean2);

            NewsPaper_Bean bean3 = new NewsPaper_Bean();
            bean3.setName("人民日报");
            bean3.setUrl("http://epaper.tibet3.com/qhzwb/html/2018-11/09/node_222.htm#");
            list.add(bean3);

            NewsPaper_Bean bean4 = new NewsPaper_Bean();
            bean4.setName("海南州新闻网");
            bean4.setUrl("http://www.hnznews.com/");
            list.add(bean4);

            NewsPaper_Bean bean5 = new NewsPaper_Bean();
            bean5.setName("藏族网通");
            bean5.setUrl("http://www.tibet3.cn/");
            list.add(bean5);

            NewsPaper_Bean bean6 = new NewsPaper_Bean();
            bean6.setName("青海湖网站");
            bean6.setUrl("http://www.amdotibet.cn/");
            list.add(bean6);
        }else{
            NewsPaper_Bean bean1 = new NewsPaper_Bean();

            bean1.setName("མཚོ་ལྷོའི་བོད་ཡིག་ཚགས་པར།");
            bean1.setUrl("http://hnzw.x-publish.com/");
            list.add(bean1);

            NewsPaper_Bean bean2 = new NewsPaper_Bean();
            bean2.setName("མི་དམངས་ཉིན་རེའི་ཚགས་པར།");
            bean2.setUrl("http://tibet.cpc.people.com.cn/");
            list.add(bean2);

            NewsPaper_Bean bean3 = new NewsPaper_Bean();
            bean3.setName("མཚོ་སྔོན་བོད་ཡིག་གསར་འགྱུར།");
            bean3.setUrl("http://epaper.tibet3.com/qhzwb/html/2018-11/09/node_222.htm#");
            list.add(bean3);

            NewsPaper_Bean bean4 = new NewsPaper_Bean();
            bean4.setName("མཚོ་ལྷོ་ཁུལ་གསར་འགྱུར་དྲ་བ།");
            bean4.setUrl("http://www.hnznews.com/");
            list.add(bean4);

            NewsPaper_Bean bean5 = new NewsPaper_Bean();
            bean5.setName("ཀྲུང་གོ་བོད་ཀྱི་དྲ་བ།");
            bean5.setUrl("http://www.tibet3.cn/");
            list.add(bean5);

            NewsPaper_Bean bean6 = new NewsPaper_Bean();
            bean6.setName("མཚོ་སྔོན་པོའི་དྲ་བ།");
            bean6.setUrl("http://www.amdotibet.cn/");
            list.add(bean6);
        }


        adapter = new NewsPaperListAdapter(list,activity);
        mynews_listview.setAdapter(adapter);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }
}
